export default{
    namespaced:true,
    state:{
        count:0
    },
    mutations:{
        INCREMENT_COUNT(state,payload){
            state.count=state.count+payload
        }
    },
    actions:{
        incrementAsync(cxt,payload){
            setTimeout(() => {
                cxt.commit('INCREMENT_COUNT',payload)
            }, 2000);
        }
    },
    getters:{
        doubleCount(state){
            return state.count*2
        }
    }
}